04. Gazebo Basics
What is Gazebo?
Gazebo is a physics based high fidelity 3D simulator for robotics. Gazebo provides the ability to accurately simulate one or more robots in complex indoor and outdoor environments filled with static and dynamic objects, realistic lighting, and programmable interactions.
Gazebo facilitates robot design, rapid prototyping & testing, and simulation of real-life scenarios. While Gazebo is platform agnostic and supports Windows, Mac, and Linux, it is mostly used in conjunction with ROS on Linux systems for robotics development. Simply put, it is an essential tool in every roboticist's arsenal. For more information on the history of Gazebo and a comprehensive list of features visit their website.
Gazebo Components
The two main components involved in running an instance of Gazebo simulation are gzserver and gzclient.
gzserver performs most of the heavy-lifting for Gazebo. It is responsible for parsing the description files related to the scene we are trying to simulate as well as the objects within, it then simulates the complete scene using a physics and sensor engine.
While the server can be launched independently by using the following command in a terminal:
$ gzserver
it does not have any GUI component. Running gzserver in a so-called headless mode can come in handy in certain situations, but we will talk more about that in future lessons.
gzclient on the other hand provides the very essential Graphical Client that connects to the gzserver and renders the simulation scene along with useful interactive tools. While you can technically run gzclient by itself using the following command:
$ gzclient
it does nothing at all (except consume your compute resources), since it does not have a gzserver to connect to.
It is a common practice to run gzserver first, followed by gzclient, allowing some time to initialize the simulation scene, objects within, and associated parameters before rendering it. To make our lives easier, there is a single intuitive command that necessarily launches both the components sequentially:
$ gazebo
Next up, we will learn more about Gazebo's user interface, how to easily navigate around, and start playing with it!